package star;
class Star implements Comparable<Star> {
    String name;
    int vol;
    int dist;

    public Star(String name, int vol, int dist) {
        this.name = name;
        this.vol = vol;
        this.dist = dist;
    }

    @Override
    public int compareTo(Star other) {
        if (this.vol != other.vol) {
            return other.vol - this.vol;
        } else {
            return this.dist - other.dist;
        }
    }

    @Override
    public String toString() {
        return "Star [name='" + name + '\'' + ", vol=" + vol + ", dist=" + dist + ']';
    }
}
